home *** CD-ROM | disk | other *** search
/ SGI Hot Mix 11 / Hot Mix 11.iso / .all / bin / check4netscape.csh (.txt) < prev    next >
Linux/UNIX/POSIX Shell Script  |  1995-06-22  |  4KB  |  116 lines

  1. #!/bin/csh -f
  2. #
  3. #  NS_STATUS 1 = same   version found
  4. #  NS_STATUS 2 = older  version found
  5. #  NS_STATUS 3 = newer  version found
  6. #  NS_STATUS 4 = use CD version        (default)
  7. set NS_STATUS=0
  8. if (`echo $cwd:t` == 'netscape') then
  9.     cd ..
  10.     set loc=`which netscape`
  11.     cd ./netscape
  12. else
  13.     set loc=`which netscape`
  14. endif
  15. set no_loc=`echo $loc | /usr/bin/awk '{print $2}' | grep not`
  16.  
  17. if ($OSVER < 53) then
  18.  
  19. ###############################################################
  20. echo "Checking for Netscape 1.0S for the 5.2 OS...." >> $HM10LOG
  21. ###############################################################
  22.  
  23.     # Check to see if Netscape Communications version of the Navigator is installed
  24.     if ( `versions Netscape Mozilla | grep Communications | wc -l` > 0 ) then
  25.     echo "Found Netscape Communications Netscape Navigator, checking version..." >> $HM10LOG
  26.     if ( `versions -n Netscape Mozilla | awk '{print$3}' | tail -1` < 943499999 ) then
  27.         echo "You have an older version of the Netscape Navigator installed." >> $HM10LOG
  28.         set NS_STATUS=2
  29.     else
  30.         echo "You appear have a newer version of Netscape Navigator." >> $HM10LOG
  31.         set NS_STATUS=3 
  32.     endif
  33.     else
  34.     if ( $no_loc == 'not' ) then
  35.                 echo "It appears that you do not have any versions of netscape installed" >> $HM10LOG
  36.                 set NS_STATUS=4
  37.     else 
  38.         if ( $no_loc == 'not' && $loc == '/usr/sbin/netscape' ) then
  39.             echo "You have an older version of Netscape Navigator installed." >> $HM10LOG
  40.             set NS_STATUS=2 
  41.         else 
  42.                 set VERSION_NUM = `versions -n netscape | awk '{print$3}' | tail -1`
  43. #                echo "Netscape Navigator VERSION_NUM=$VERSION_NUM"
  44.                 if ( $loc == '/usr/bin/X11/netscape' ) then
  45.                 if ( $VERSION_NUM == 1011009700 ) then
  46.                     echo "It appears that you have the SAME version of Netscape Navigator 1.0S." >> $HM10LOG
  47.                     set NS_STATUS=1
  48.                 else
  49.                     if ( $VERSION_NUM < 1011009700 ) then
  50.                         echo "It appears that you have an older version of Netscape Navigator 1.0S." >> $HM10LOG
  51.                         set NS_STATUS=2
  52.                     endif
  53.                 endif
  54.             endif
  55.         endif
  56.     endif
  57.     endif
  58.  
  59. else
  60.  
  61. ###############################################################
  62. echo "Checking for Netscape 1.0S for the 5.3 OS...." >> $HM10LOG
  63. ###############################################################
  64.  
  65.     # Check to see if Netscape Communications version of the Navigator is installed
  66.     if ( `versions Netscape Mozilla | grep Communications | wc -l` > 0 ) then
  67.     echo "Found Netscape Communications Netscape Navigator, checking version..." >> $HM10LOG
  68.     if ( `versions -bn Netscape Mozilla | awk '{print$3}' | tail -1` < 943499999 ) then
  69.         echo "You have an older version of the Netscape Navigator installed." >> $HM10LOG
  70.         set NS_STATUS=2
  71.     else
  72.         echo "You appear have a newer version of Netscape Navigator." >> $HM10LOG
  73.         set NS_STATUS=3
  74.     endif
  75.     else
  76.         
  77.         if ( $no_loc == 'not') then
  78.                 echo "It appears that you do not have any versions of netscape installed" >> $HM10LOG
  79.                 set NS_STATUS=4
  80.         else
  81.  
  82.             if ( $no_loc != 'not'  && $loc == '/usr/sbin/netscape' ) then
  83.                 echo "You have an older version of Netscape Navigator installed." >> $HM10LOG
  84.         set NS_STATUS=2
  85.         else 
  86.                 set VERSION_NUM = `versions -bn netscape | awk '{print$3}' | tail -1`
  87. #        echo "Netscape Navigator VERSION_NUM=$VERSION_NUM" >> $HM10LOG
  88.                 if ( $loc == '/usr/bin/X11/netscape' ) then
  89.                     if ( $VERSION_NUM < 1021929620 ) then
  90.                         echo "It appears that you have an older version of Netscape Navigator 1.0S." >> $HM10LOG
  91.                         set NS_STATUS=2
  92.             else 
  93.                         if ( $VERSION_NUM == 1021929620 ) then
  94.                             echo "It appears that you have the SAME version of Netscape Navigator 1.0S." >> $HM10LOG
  95.                             set NS_STATUS=1
  96.                         else
  97.                             echo "It appears that you have the Newer version of Netscape Navigator 1.0S." >> $HM10LOG
  98.                             set NS_STATUS=3
  99.                         endif
  100.             endif
  101.                 endif
  102.             endif
  103.     endif
  104.     endif
  105.  
  106. ###############################################################
  107.  
  108. endif
  109.  
  110. exit $NS_STATUS 
  111.  
  112.  
  113.  
  114.